using System;
using System.Collections.Generic;
using System.Text;

namespace ReinforcementLearning
{
    public class ActionValueComparator: IComparer<ActionValue>
    {
        private static ActionValueComparator avComparator;
        
        private ActionValueComparator()
        {
          
        }

        public static ActionValueComparator getInstance()
        {
            if (avComparator == null)
            {
                avComparator = new ActionValueComparator();
            }

            return avComparator;
        }

        int IComparer<ActionValue>.Compare(ActionValue av1, ActionValue av2)
        {
            int ret = 0;
            
            if (av1.value < av2.value)
            {
                ret = 1;
            }
            else if (av1.value > av2.value)
            {
                ret = -1;
            }

            return ret;
        }
    }
}
